package ua.selenium.search;

import java.util.List;
import java.util.NoSuchElementException;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

public class SearchNonExistingFilm extends ua.selenium.search.pages.TestBase {

	@Test
	public void searchNonExistingFilm() throws Exception {

		WebElement searchField = driver.findElement(By.id("q"));
		searchField.click();
		searchField.clear();
		searchField.sendKeys("abracadabra");
		searchField.sendKeys(Keys.RETURN);
		
		driver.findElement(By.xpath("//*[.='No movies where found.']"));
		/*if (!isElementPresent(By.xpath("//*[.='No movies where found.']"))) {
			throw new NoSuchElementException();
		}
*/
	}
}